package hk.com.fwd.util;

import java.io.File;
import java.io.InputStream;

/**
 * Created by lianghm.ext on 2019/7/30.
 */
public class FileUtil {

    /**
     *  ajust the path exist or not
     * @param dirPath
     * @return
     */
   public static String isChartPathExist(String dirPath){
       File file=new File(dirPath);
       if (!file.exists()){
           file.mkdir();
       }
       return dirPath;
   }


    public InputStream getPath(String path){
        InputStream stream =null;
        try {
            stream = getClass().getClassLoader().getResourceAsStream(path);
        } catch (Exception  e) {
            e.printStackTrace();
        }finally {
        }
        return stream;
    }




/*
    public  static void main(String arg[]){
        FileUtil fileUtil=new FileUtil();
        InputStream stream=fileUtil.getPath("jrxmls/test.txt");
        System.out.println(stream);
    }
*/

}
